]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st/theme-context: Add a getter for the scale-factor property
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Mon, 6 Apr 2020 14:15:38 +0000 (11:15 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Mon, 6 Apr 2020 14:24:30 +0000 (11:24 -0300)
Will be used by the next commit to avoid going through the GObject
machinery when retrieving the scale factor.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1176

src/st/st-theme-context.c
src/st/st-theme-context.h

index bc0f89a4e2b181505993ed51d9c44c1ef55f0424..55e856f265fbaade0a88600350a4104312ee3f42 100644 (file)
@@ -469,3 +469,19 @@ st_theme_context_intern_node (StThemeContext *context,
   g_hash_table_add (context->nodes, g_object_ref (node));
   return node;
 }
+
+/**
+ * st_theme_context_get_scale_factor:
+ * @context: a #StThemeContext
+ *
+ * Return the current scale factor of @context.
+ *
+ * Return value: a scale factor
+ */
+int
+st_theme_context_get_scale_factor (StThemeContext *context)
+{
+  g_return_val_if_fail (ST_IS_THEME_CONTEXT (context), -1);
+
+  return context->scale_factor;
+}
index efb3531e26c866fa976acb1566af4277b0aeeb74..165ce25f19228bc0cc88a576dc527fecdf67d5bf 100644 (file)
@@ -58,6 +58,8 @@ StThemeNode *               st_theme_context_get_root_node  (StThemeContext
 StThemeNode *               st_theme_context_intern_node    (StThemeContext             *context,
                                                              StThemeNode                *node);
 
+int st_theme_context_get_scale_factor (StThemeContext *context);
+
 G_END_DECLS
 
 #endif /* __ST_THEME_CONTEXT_H__ */